3.21 \(\int \frac {(a+b \sin (c+d x^2))^2}{x^2} \, dx\)

Optimal. Leaf size=187 \[ -\frac {2 a^2+b^2}{2 x}+2 \sqrt {2 \pi } a b \sqrt {d} \cos (c) C\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-2 \sqrt {2 \pi } a b \sqrt {d} \sin (c) S\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-\frac {2 a b \sin \left (c+d x^2\right )}{x}+\sqrt {\pi } b^2 \sqrt {d} \sin (2 c) C\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )+\sqrt {\pi } b^2 \sqrt {d} \cos (2 c) S\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )+\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x} \]

[Out]

1/2*(-2*a^2-b^2)/x+1/2*b^2*cos(2*d*x^2+2*c)/x-2*a*b*sin(d*x^2+c)/x+b^2*cos(2*c)*FresnelS(2*x*d^(1/2)/Pi^(1/2))
*d^(1/2)*Pi^(1/2)+b^2*FresnelC(2*x*d^(1/2)/Pi^(1/2))*sin(2*c)*d^(1/2)*Pi^(1/2)+2*a*b*cos(c)*FresnelC(x*d^(1/2)
*2^(1/2)/Pi^(1/2))*d^(1/2)*2^(1/2)*Pi^(1/2)-2*a*b*FresnelS(x*d^(1/2)*2^(1/2)/Pi^(1/2))*sin(c)*d^(1/2)*2^(1/2)*
Pi^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.16, antiderivative size = 187, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 8, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {3403, 6, 3388, 3353, 3352, 3351, 3387, 3354} \[ -\frac {2 a^2+b^2}{2 x}+2 \sqrt {2 \pi } a b \sqrt {d} \cos (c) \text {FresnelC}\left (\sqrt {\frac {2}{\pi }} \sqrt {d} x\right )-2 \sqrt {2 \pi } a b \sqrt {d} \sin (c) S\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-\frac {2 a b \sin \left (c+d x^2\right )}{x}+\sqrt {\pi } b^2 \sqrt {d} \sin (2 c) \text {FresnelC}\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )+\sqrt {\pi } b^2 \sqrt {d} \cos (2 c) S\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )+\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[c + d*x^2])^2/x^2,x]

[Out]

-(2*a^2 + b^2)/(2*x) + (b^2*Cos[2*c + 2*d*x^2])/(2*x) + 2*a*b*Sqrt[d]*Sqrt[2*Pi]*Cos[c]*FresnelC[Sqrt[d]*Sqrt[
2/Pi]*x] + b^2*Sqrt[d]*Sqrt[Pi]*Cos[2*c]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]] - 2*a*b*Sqrt[d]*Sqrt[2*Pi]*FresnelS[
Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c] + b^2*Sqrt[d]*Sqrt[Pi]*FresnelC[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c] - (2*a*b*Sin[c +
 d*x^2])/x

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, x]

Rule 3351

Int[Sin[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelS[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rule 3352

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rule 3353

Int[Sin[(c_) + (d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Dist[Sin[c], Int[Cos[d*(e + f*x)^2], x], x] + Dist[
Cos[c], Int[Sin[d*(e + f*x)^2], x], x] /; FreeQ[{c, d, e, f}, x]

Rule 3354

Int[Cos[(c_) + (d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Dist[Cos[c], Int[Cos[d*(e + f*x)^2], x], x] - Dist[
Sin[c], Int[Sin[d*(e + f*x)^2], x], x] /; FreeQ[{c, d, e, f}, x]

Rule 3387

Int[((e_.)*(x_))^(m_)*Sin[(c_.) + (d_.)*(x_)^(n_)], x_Symbol] :> Simp[((e*x)^(m + 1)*Sin[c + d*x^n])/(e*(m + 1
)), x] - Dist[(d*n)/(e^n*(m + 1)), Int[(e*x)^(m + n)*Cos[c + d*x^n], x], x] /; FreeQ[{c, d, e}, x] && IGtQ[n,
0] && LtQ[m, -1]

Rule 3388

Int[Cos[(c_.) + (d_.)*(x_)^(n_)]*((e_.)*(x_))^(m_), x_Symbol] :> Simp[((e*x)^(m + 1)*Cos[c + d*x^n])/(e*(m + 1
)), x] + Dist[(d*n)/(e^n*(m + 1)), Int[(e*x)^(m + n)*Sin[c + d*x^n], x], x] /; FreeQ[{c, d, e}, x] && IGtQ[n,
0] && LtQ[m, -1]

Rule 3403

Int[((e_.)*(x_))^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_), x_Symbol] :> Int[ExpandTrigReduce[(e
*x)^m, (a + b*Sin[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[p, 1] && IGtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^2} \, dx &=\int \left (\frac {a^2}{x^2}+\frac {b^2}{2 x^2}-\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x^2}+\frac {2 a b \sin \left (c+d x^2\right )}{x^2}\right ) \, dx\\ &=\int \left (\frac {a^2+\frac {b^2}{2}}{x^2}-\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x^2}+\frac {2 a b \sin \left (c+d x^2\right )}{x^2}\right ) \, dx\\ &=-\frac {2 a^2+b^2}{2 x}+(2 a b) \int \frac {\sin \left (c+d x^2\right )}{x^2} \, dx-\frac {1}{2} b^2 \int \frac {\cos \left (2 c+2 d x^2\right )}{x^2} \, dx\\ &=-\frac {2 a^2+b^2}{2 x}+\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x}-\frac {2 a b \sin \left (c+d x^2\right )}{x}+(4 a b d) \int \cos \left (c+d x^2\right ) \, dx+\left (2 b^2 d\right ) \int \sin \left (2 c+2 d x^2\right ) \, dx\\ &=-\frac {2 a^2+b^2}{2 x}+\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x}-\frac {2 a b \sin \left (c+d x^2\right )}{x}+(4 a b d \cos (c)) \int \cos \left (d x^2\right ) \, dx+\left (2 b^2 d \cos (2 c)\right ) \int \sin \left (2 d x^2\right ) \, dx-(4 a b d \sin (c)) \int \sin \left (d x^2\right ) \, dx+\left (2 b^2 d \sin (2 c)\right ) \int \cos \left (2 d x^2\right ) \, dx\\ &=-\frac {2 a^2+b^2}{2 x}+\frac {b^2 \cos \left (2 c+2 d x^2\right )}{2 x}+2 a b \sqrt {d} \sqrt {2 \pi } \cos (c) C\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )+b^2 \sqrt {d} \sqrt {\pi } \cos (2 c) S\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )-2 a b \sqrt {d} \sqrt {2 \pi } S\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right ) \sin (c)+b^2 \sqrt {d} \sqrt {\pi } C\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right ) \sin (2 c)-\frac {2 a b \sin \left (c+d x^2\right )}{x}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.51, size = 184, normalized size = 0.98 \[ \frac {-2 a^2+4 \sqrt {2 \pi } a b \sqrt {d} x \cos (c) C\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-4 \sqrt {2 \pi } a b \sqrt {d} x \sin (c) S\left (\sqrt {d} \sqrt {\frac {2}{\pi }} x\right )-4 a b \sin \left (c+d x^2\right )+2 \sqrt {\pi } b^2 \sqrt {d} x \sin (2 c) C\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )+2 \sqrt {\pi } b^2 \sqrt {d} x \cos (2 c) S\left (\frac {2 \sqrt {d} x}{\sqrt {\pi }}\right )+b^2 \cos \left (2 \left (c+d x^2\right )\right )-b^2}{2 x} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[c + d*x^2])^2/x^2,x]

[Out]

(-2*a^2 - b^2 + b^2*Cos[2*(c + d*x^2)] + 4*a*b*Sqrt[d]*Sqrt[2*Pi]*x*Cos[c]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x] + 2*
b^2*Sqrt[d]*Sqrt[Pi]*x*Cos[2*c]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]] - 4*a*b*Sqrt[d]*Sqrt[2*Pi]*x*FresnelS[Sqrt[d]
*Sqrt[2/Pi]*x]*Sin[c] + 2*b^2*Sqrt[d]*Sqrt[Pi]*x*FresnelC[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c] - 4*a*b*Sin[c + d*x
^2])/(2*x)

________________________________________________________________________________________

fricas [A]  time = 0.71, size = 159, normalized size = 0.85 \[ \frac {2 \, \sqrt {2} \pi a b x \sqrt {\frac {d}{\pi }} \cos \relax (c) \operatorname {C}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) - 2 \, \sqrt {2} \pi a b x \sqrt {\frac {d}{\pi }} \operatorname {S}\left (\sqrt {2} x \sqrt {\frac {d}{\pi }}\right ) \sin \relax (c) + \pi b^{2} x \sqrt {\frac {d}{\pi }} \cos \left (2 \, c\right ) \operatorname {S}\left (2 \, x \sqrt {\frac {d}{\pi }}\right ) + \pi b^{2} x \sqrt {\frac {d}{\pi }} \operatorname {C}\left (2 \, x \sqrt {\frac {d}{\pi }}\right ) \sin \left (2 \, c\right ) + b^{2} \cos \left (d x^{2} + c\right )^{2} - 2 \, a b \sin \left (d x^{2} + c\right ) - a^{2} - b^{2}}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2/x^2,x, algorithm="fricas")

[Out]

(2*sqrt(2)*pi*a*b*x*sqrt(d/pi)*cos(c)*fresnel_cos(sqrt(2)*x*sqrt(d/pi)) - 2*sqrt(2)*pi*a*b*x*sqrt(d/pi)*fresne
l_sin(sqrt(2)*x*sqrt(d/pi))*sin(c) + pi*b^2*x*sqrt(d/pi)*cos(2*c)*fresnel_sin(2*x*sqrt(d/pi)) + pi*b^2*x*sqrt(
d/pi)*fresnel_cos(2*x*sqrt(d/pi))*sin(2*c) + b^2*cos(d*x^2 + c)^2 - 2*a*b*sin(d*x^2 + c) - a^2 - b^2)/x

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (b \sin \left (d x^{2} + c\right ) + a\right )}^{2}}{x^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2/x^2,x, algorithm="giac")

[Out]

integrate((b*sin(d*x^2 + c) + a)^2/x^2, x)

________________________________________________________________________________________

maple [A]  time = 0.06, size = 137, normalized size = 0.73 \[ -\frac {a^{2}+\frac {b^{2}}{2}}{x}-\frac {b^{2} \left (-\frac {\cos \left (2 d \,x^{2}+2 c \right )}{x}-2 \sqrt {d}\, \sqrt {\pi }\, \left (\cos \left (2 c \right ) \mathrm {S}\left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )+\sin \left (2 c \right ) \FresnelC \left (\frac {2 x \sqrt {d}}{\sqrt {\pi }}\right )\right )\right )}{2}+2 a b \left (-\frac {\sin \left (d \,x^{2}+c \right )}{x}+\sqrt {d}\, \sqrt {2}\, \sqrt {\pi }\, \left (\cos \relax (c ) \FresnelC \left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )-\sin \relax (c ) \mathrm {S}\left (\frac {x \sqrt {d}\, \sqrt {2}}{\sqrt {\pi }}\right )\right )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(d*x^2+c))^2/x^2,x)

[Out]

-(a^2+1/2*b^2)/x-1/2*b^2*(-1/x*cos(2*d*x^2+2*c)-2*d^(1/2)*Pi^(1/2)*(cos(2*c)*FresnelS(2*x*d^(1/2)/Pi^(1/2))+si
n(2*c)*FresnelC(2*x*d^(1/2)/Pi^(1/2))))+2*a*b*(-1/x*sin(d*x^2+c)+d^(1/2)*2^(1/2)*Pi^(1/2)*(cos(c)*FresnelC(x*d
^(1/2)*2^(1/2)/Pi^(1/2))-sin(c)*FresnelS(x*d^(1/2)*2^(1/2)/Pi^(1/2))))

________________________________________________________________________________________

maxima [C]  time = 0.61, size = 170, normalized size = 0.91 \[ -\frac {\sqrt {d x^{2}} {\left ({\left (\left (i - 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, i \, d x^{2}\right ) - \left (i + 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, -i \, d x^{2}\right )\right )} \cos \relax (c) + {\left (\left (i + 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, i \, d x^{2}\right ) - \left (i - 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, -i \, d x^{2}\right )\right )} \sin \relax (c)\right )} a b}{4 \, x} - \frac {{\left (\sqrt {2} \sqrt {d x^{2}} {\left ({\left (-\left (i + 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, 2 i \, d x^{2}\right ) + \left (i - 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, -2 i \, d x^{2}\right )\right )} \cos \left (2 \, c\right ) + {\left (\left (i - 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, 2 i \, d x^{2}\right ) - \left (i + 1\right ) \, \sqrt {2} \Gamma \left (-\frac {1}{2}, -2 i \, d x^{2}\right )\right )} \sin \left (2 \, c\right )\right )} + 8\right )} b^{2}}{16 \, x} - \frac {a^{2}}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2/x^2,x, algorithm="maxima")

[Out]

-1/4*sqrt(d*x^2)*(((I - 1)*sqrt(2)*gamma(-1/2, I*d*x^2) - (I + 1)*sqrt(2)*gamma(-1/2, -I*d*x^2))*cos(c) + ((I
+ 1)*sqrt(2)*gamma(-1/2, I*d*x^2) - (I - 1)*sqrt(2)*gamma(-1/2, -I*d*x^2))*sin(c))*a*b/x - 1/16*(sqrt(2)*sqrt(
d*x^2)*((-(I + 1)*sqrt(2)*gamma(-1/2, 2*I*d*x^2) + (I - 1)*sqrt(2)*gamma(-1/2, -2*I*d*x^2))*cos(2*c) + ((I - 1
)*sqrt(2)*gamma(-1/2, 2*I*d*x^2) - (I + 1)*sqrt(2)*gamma(-1/2, -2*I*d*x^2))*sin(2*c)) + 8)*b^2/x - a^2/x

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {{\left (a+b\,\sin \left (d\,x^2+c\right )\right )}^2}{x^2} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(c + d*x^2))^2/x^2,x)

[Out]

int((a + b*sin(c + d*x^2))^2/x^2, x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (a + b \sin {\left (c + d x^{2} \right )}\right )^{2}}{x^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x**2+c))**2/x**2,x)

[Out]

Integral((a + b*sin(c + d*x**2))**2/x**2, x)

________________________________________________________________________________________